package com.listeningframework.boot.codegen.exception;

/**
 * 
 * @description 异常Code枚举
 * 
 * @author listening
 * @version $Id: ExceptionCode.java, v 0.1 2015年6月12日 下午5:33:02 listening Exp $
 */
public enum ExceptionCode {

    SUCCESS("000000", "成功"),

    PARAM_MISSING("000001", "参数缺失"),

    EXCEPTION("000002", "程序异常"),

    FAIL("000003", "程序失败(未达到预期值)"),

    MESSAGE("000004", "自定义信息提示");

    private String code;
    private String desc;

    private ExceptionCode(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static boolean isSuccess(String code) {
        return SUCCESS.getCode().equals(code);
    }

}
